<template>
  <div @click="divdian">
    <a @click.prevent="zuzhi" :href="url">阻止去百度</a>
    <div @click.stop="dianji">儿子被点击了阻止冒泡</div>
    <input @keydown.enter="enter" @click.stop="" type="text" />
    <input @keydown.esc="esc"  @click.stop="" type="text" />
  </div>
</template>

<script>
export default {
  name: "VuecliDomeApp",

  data() {
    return {
      url: "http://www.baidu.com",
    };
  },

  methods: {
    divdian() {
      console.log("爸爸被点击了");
    },
    dianji() {
      console.log("儿子被点击了");
    },
    enter() {
      console.log("回车被点击了");
    },
    esc() {
      console.log("esc被点击l");
    },
  },
};
</script>

<style lang="scss" scoped>
</style>